package com.lz.code.zkcurator.config;

import lombok.Data;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author liuzhi
 * @description
 * @date 2022/3/6 13:32
 */
@Slf4j
@Data
@ToString
@Component
@ConfigurationProperties(prefix = "curator")
public class CuratorWrapper implements InitializingBean {

    private int retryCount;

    private int elapsedTimeMs;

    private String connectString;

    private int sessionTimeoutMs;

    private int connectionTimeoutMs;

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info(String.format("CuratorWrapper init-info. %s", this));
    }

}
